﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using Sebarf.Core.Interfaces;
using Sebarf.Services.Interfaces;

#endregion

namespace Sebarf.Services.Impl {
	/// <summary>
	/// Description of the class
	/// </summary>
	public class SetupServicesRequestHandler : RequestHandler<SetupServicesRequest> {
		#region Public Methods

		protected override object OnProcessRequest(SetupServicesRequest request, IServiceLocatorService serviceLocator) {
			foreach (IServiceImpl service in
				serviceLocator.GetRegisteredService<IDiagnosticsServiceLocatorService>().GetAllRegisteredServices<IServiceImpl>()) {
				IServiceImpl castedService = service;
				if (castedService != null) {
					castedService.DoSetup();
				}
			}
			return true;
		}

		#endregion
	}
}